<!DOCTYPE html>
<html lang="zh">
<head><meta name="generator" content="Hexo 3.8.0">
    <meta charset="utf-8">
<title>gitalk set - YuThree</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">



    <meta name="description" content="就在昨天进入Valine 评论后台发现没有自己域名的调用在10月1号就会停止服务，我也没有那个需求要专门给自己的博客买一个域名，所以换了一个评论插件gitalk">
<meta name="keywords" content="hexo,gitakl">
<meta property="og:type" content="article">
<meta property="og:title" content="gitalk set">
<meta property="og:url" content="https://yuthree.github.io/2019/08/06/gitalk-set/index.html">
<meta property="og:site_name" content="YuThree">
<meta property="og:description" content="就在昨天进入Valine 评论后台发现没有自己域名的调用在10月1号就会停止服务，我也没有那个需求要专门给自己的博客买一个域名，所以换了一个评论插件gitalk">
<meta property="og:locale" content="zh-CN">
<meta property="og:image" content="https://yuthree.github.io/images/titlebg_20.jpg">
<meta property="og:updated_time" content="2019-08-27T07:22:40.098Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="gitalk set">
<meta name="twitter:description" content="就在昨天进入Valine 评论后台发现没有自己域名的调用在10月1号就会停止服务，我也没有那个需求要专门给自己的博客买一个域名，所以换了一个评论插件gitalk">
<meta name="twitter:image" content="https://yuthree.github.io/images/titlebg_20.jpg">
<meta property="fb:admins" content="100011677446168">
<meta property="fb:app_id" content="100011677446168">







<link rel="icon" href="/images/favicon.ico">


<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bulma@0.7.2/css/bulma.css">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.4.1/css/all.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Ubuntu:400,600|Source+Code+Pro">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/highlight.js@9.12.0/styles/vs2015.css">


    
    
    
    <style>body>.footer,body>.navbar,body>.section{opacity:0}</style>
    

    
    
    
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/lightgallery@1.6.8/dist/css/lightgallery.min.css">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/justifiedGallery@3.7.0/dist/css/justifiedGallery.min.css">
    

    
    

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/outdatedbrowser@1.1.5/outdatedbrowser/outdatedbrowser.min.css">


    
    
    
    

<link rel="stylesheet" href="/css/back-to-top.css">


    
    

    
    
    
    

    
    
<link rel="stylesheet" href="/css/progressbar.css">
<script src="https://cdn.jsdelivr.net/npm/pace-js@1.0.2/pace.min.js"></script>

    
    
    
    
    
        <script async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
    

    


<link rel="stylesheet" href="/css/style.css">
</head>
<body class="is-2-column">
    <nav class="navbar navbar-main">
    <div class="container">
        <div class="navbar-brand is-flex-center">
            <a class="navbar-item navbar-logo" href="/">
            
                <img src="/images/logo.svg" alt="gitalk set" height="28">
            
            </a>
        </div>
        <div class="navbar-menu">
            
            <div class="navbar-start">
                
                <a class="navbar-item" href="/">首页</a>
                
                <a class="navbar-item" href="/archives">历史</a>
                
                <a class="navbar-item" href="/categories">分类</a>
                
                <a class="navbar-item" href="/tags">标签</a>
                
                <a class="navbar-item" href="/about">关于</a>
                
            </div>
            
            <div class="navbar-end">
                
                
                <a class="navbar-item is-hidden-tablet catalogue" title="目录" href="javascript:;">
                    <i class="fas fa-list-ul"></i>
                </a>
                
                
                <a class="navbar-item search" title="搜索" href="javascript:;">
                    <i class="fas fa-search"></i>
                </a>
                
            </div>
        </div>
    </div>
</nav>
    
    <section class="section">
        <div class="container">
            <div class="columns">
                <div class="column is-8-tablet is-9-desktop is-9-widescreen has-order-2 column-main"><div class="card">
    
    <div class="card-image">
        <span class="image is-7by1">
            <img class="thumbnail" src="/images/titlebg_20.jpg" alt="gitalk set">
        </span>
    </div>
    
    <div class="card-content article ">
        
        <div class="level article-meta is-size-7 is-uppercase is-mobile is-overflow-x-auto">
            <div class="level-left">
                <time class="level-item has-text-grey" datetime="2019-08-06T02:22:34.000Z">2019-08-06</time>
                
                <div class="level-item">
                <a class="has-link-grey -link" href="/categories/笔记/">笔记</a>&nbsp;/&nbsp;<a class="has-link-grey -link" href="/categories/笔记/hexo/">hexo</a>
                </div>
                
                
                <span class="level-item has-text-grey">
                    
                    
                    11 分钟 读完 (大约 1695 个字)
                </span>
                
                
                <span class="level-item has-text-grey" id="busuanzi_container_page_pv">
                    <i class="far fa-eye"></i>
                    <span id="busuanzi_value_page_pv">0</span>次访问
                </span>
                
            </div>
        </div>
        
        <h1 class="title is-size-3 is-size-4-mobile has-text-weight-normal">
            
                gitalk set
            
        </h1>
        <div class="content">
            <p>就在昨天进入<a href="https://valine.js.org/" target="_blank" rel="noopener">Valine</a> 评论后台发现没有自己域名的调用在10月1号就会停止服务，我也没有那个需求要专门给自己的博客买一个域名，所以换了一个评论插件<a href="https://github.com/gitalk/gitalk" target="_blank" rel="noopener">gitalk</a><br><a id="more"></a></p>
<h5 id="说道为什么需要自动化"><a href="#说道为什么需要自动化" class="headerlink" title="说道为什么需要自动化"></a>说道为什么需要自动化</h5><h5 id="原因是Gitalk配置完成后，启动hexo，打开文章页面，需要登陆github，完成初始化后才能使用，并且是每一篇没有初始化的文章都需要，虽然你如果登录了点开文章就会自动创建，但是每一篇新文章都需要点进去，博客少还好但是多了就不好搞了，所以这个自动初始化很有必要，gitakl怎么加入博客这个官网-就有例子，照着做就行了，网上也很多比如这个-，自动初始化的我找了下都是什么py或者其他自动化语言写的，我这用的node搞了一个"><a href="#原因是Gitalk配置完成后，启动hexo，打开文章页面，需要登陆github，完成初始化后才能使用，并且是每一篇没有初始化的文章都需要，虽然你如果登录了点开文章就会自动创建，但是每一篇新文章都需要点进去，博客少还好但是多了就不好搞了，所以这个自动初始化很有必要，gitakl怎么加入博客这个官网-就有例子，照着做就行了，网上也很多比如这个-，自动初始化的我找了下都是什么py或者其他自动化语言写的，我这用的node搞了一个" class="headerlink" title="原因是Gitalk配置完成后，启动hexo，打开文章页面，需要登陆github，完成初始化后才能使用，并且是每一篇没有初始化的文章都需要，虽然你如果登录了点开文章就会自动创建，但是每一篇新文章都需要点进去，博客少还好但是多了就不好搞了，所以这个自动初始化很有必要，gitakl怎么加入博客这个官网 就有例子，照着做就行了，网上也很多比如这个 ，自动初始化的我找了下都是什么py或者其他自动化语言写的，我这用的node搞了一个"></a>原因是Gitalk配置完成后，启动hexo，打开文章页面，需要登陆github，完成初始化后才能使用，并且是每一篇没有初始化的文章都需要，虽然你如果登录了点开文章就会自动创建，但是每一篇新文章都需要点进去，博客少还好但是多了就不好搞了，所以这个自动初始化很有必要，gitakl怎么加入博客这个<a href="https://github.com/gitalk/gitalk" target="_blank" rel="noopener">官网</a> 就有例子，照着做就行了，网上也很多<a href="https://iochen.com/2018/01/06/use-gitalk-in-hexo/" target="_blank" rel="noopener">比如这个</a> ，自动初始化的我找了下都是什么py或者其他自动化语言写的，我这用的node搞了一个</h5><hr>
<h1 id="gitalk-setting"><a href="#gitalk-setting" class="headerlink" title="gitalk setting"></a>gitalk setting</h1><h2 id="实现gitalk-自动为文章生成评论栏"><a href="#实现gitalk-自动为文章生成评论栏" class="headerlink" title="实现gitalk 自动为文章生成评论栏"></a>实现gitalk 自动为文章生成评论栏</h2><h3 id="第一步-获取github接口的调用权限"><a href="#第一步-获取github接口的调用权限" class="headerlink" title="第一步 获取github接口的调用权限"></a>第一步 获取github接口的调用权限</h3><ol>
<li>创建一个access token，<a href="https://github.com/settings/tokens" target="_blank" rel="noopener">点击链接进入</a> </li>
<li>点击<code>Generate new token</code></li>
<li>添加所有的repo权限 在repo前面打勾勾 然后点击最下方的<code>Generate token</code>绿色按钮，就可以生成一个新的<code>Token</code>备用</li>
</ol>
<h3 id="生成sitemap站点地图"><a href="#生成sitemap站点地图" class="headerlink" title="生成sitemap站点地图"></a>生成sitemap站点地图</h3><blockquote>
<p>站点地图是一种文件，您可以通过该文件列出您网站上的网页，从而将您网站内容的组织架构告知Google和其他搜索引擎。搜索引擎网页抓取工具会读取此文件，以便更加智能地抓取您的网站</p>
</blockquote>
<ol>
<li><p>安装插件<br>这里我们用这个来获取文章的路径数量信息 <code>在你hexo的根目录，执行下面两个命令来安装针对google和百度的插件</code></p>
<figure class="highlight bash hljs"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">npm install hexo-generator-sitemap --save</span><br><span class="line">npm install hexo-generator-baidu-sitemap --save</span><br></pre></td></tr></table></figure>
</li>
<li><p>在站点根目录下的_config.yml添加如下代码</p>
<figure class="highlight bash hljs"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line"><span class="hljs-comment"># hexo sitemap网站地图</span></span><br><span class="line">sitemap:</span><br><span class="line">  path: sitemap.xml</span><br><span class="line"></span><br><span class="line">baidusitemap:</span><br><span class="line">  path: baidusitemap.xml</span><br></pre></td></tr></table></figure>
</li>
</ol>
<p>到这一步 执行hexo generate的时候，在博客根目录下的public文件夹下面，就会生成sitemap.xml和baidusitemap.xml</p>
<p>More info: <a href="https://hexo.io/docs/server.html" target="_blank" rel="noopener">Server</a></p>
<h3 id="脚本文件编写"><a href="#脚本文件编写" class="headerlink" title="脚本文件编写"></a>脚本文件编写</h3><ol>
<li><p>安装依赖包<br> 在你hexo的根目录，执行下面的命令 分别是一些 请求插件，</p>
<figure class="highlight bash hljs"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">npm install request --save</span><br><span class="line">npm install xml-parser --save</span><br><span class="line">npm install yamljs --save</span><br><span class="line">npm install cheerio --save</span><br></pre></td></tr></table></figure>
</li>
<li><p>创建脚本文件</p>
</li>
</ol>
<p>在站点根目录下创建<code>comment.js</code>文件，将下面的代码粘贴进文件中，然后修改<code>config</code>中的配置项，其中<code>token</code>就是上一步中获取的值</p>
<figure class="highlight js hljs"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br><span class="line">96</span><br><span class="line">97</span><br><span class="line">98</span><br><span class="line">99</span><br><span class="line">100</span><br><span class="line">101</span><br><span class="line">102</span><br><span class="line">103</span><br><span class="line">104</span><br><span class="line">105</span><br><span class="line">106</span><br><span class="line">107</span><br><span class="line">108</span><br><span class="line">109</span><br><span class="line">110</span><br><span class="line">111</span><br><span class="line">112</span><br><span class="line">113</span><br><span class="line">114</span><br><span class="line">115</span><br></pre></td><td class="code"><pre><span class="line"><span class="hljs-comment">// 初始化gitakl 评论 </span></span><br><span class="line"></span><br><span class="line"><span class="hljs-keyword">const</span> request = <span class="hljs-built_in">require</span>(<span class="hljs-string">"request"</span>);</span><br><span class="line"><span class="hljs-keyword">const</span> fs = <span class="hljs-built_in">require</span>(<span class="hljs-string">"fs"</span>);</span><br><span class="line"><span class="hljs-keyword">const</span> path = <span class="hljs-built_in">require</span>(<span class="hljs-string">"path"</span>);</span><br><span class="line"><span class="hljs-keyword">const</span> url = <span class="hljs-built_in">require</span>(<span class="hljs-string">"url"</span>);</span><br><span class="line"><span class="hljs-keyword">const</span> xmlParser = <span class="hljs-built_in">require</span>(<span class="hljs-string">"xml-parser"</span>);</span><br><span class="line"><span class="hljs-keyword">const</span> YAML = <span class="hljs-built_in">require</span>(<span class="hljs-string">"yamljs"</span>);</span><br><span class="line"><span class="hljs-keyword">const</span> cheerio = <span class="hljs-built_in">require</span>(<span class="hljs-string">"cheerio"</span>);<span class="hljs-comment">//服务端jq</span></span><br><span class="line"><span class="hljs-keyword">const</span> crypto = <span class="hljs-built_in">require</span>(<span class="hljs-string">'crypto'</span>);<span class="hljs-comment">//md5</span></span><br><span class="line"></span><br><span class="line"><span class="hljs-comment">// 根据自己的情况进行配置</span></span><br><span class="line"><span class="hljs-keyword">const</span> config = &#123;</span><br><span class="line">    username: <span class="hljs-string">"YuThree"</span>, <span class="hljs-comment">// GitHub 用户名</span></span><br><span class="line">    token: <span class="hljs-string">"xxxxxxxxxxxxxxxxxxxxxxxx"</span>,  <span class="hljs-comment">// GitHub Token  </span></span><br><span class="line">    repo: <span class="hljs-string">"yuthreeComment"</span>,  <span class="hljs-comment">// 存放 issues的git仓库 自己创一个专门存评论的仓库</span></span><br><span class="line">    <span class="hljs-comment">// sitemap.xml的路径，commit.js放置在根目录下，无需修改，其他情况自行处理</span></span><br><span class="line">    sitemapUrl: path.resolve(__dirname, <span class="hljs-string">"./public/sitemap.xml"</span>),</span><br><span class="line">    kind: <span class="hljs-string">"Gitalk"</span>,  </span><br><span class="line">&#125;;</span><br><span class="line"><span class="hljs-keyword">let</span> issuesUrl = <span class="hljs-string">`https://api.github.com/repos/<span class="hljs-subst">$&#123;config.username&#125;</span>/<span class="hljs-subst">$&#123;config.repo&#125;</span>/issues?access_token=<span class="hljs-subst">$&#123;config.token&#125;</span>`</span>;</span><br><span class="line"></span><br><span class="line"><span class="hljs-keyword">let</span> requestGetOpt = &#123;</span><br><span class="line">    url: <span class="hljs-string">`<span class="hljs-subst">$&#123;issuesUrl&#125;</span>&amp;page=1&amp;per_page=1000`</span>,</span><br><span class="line">    json: <span class="hljs-literal">true</span>,</span><br><span class="line">    headers: &#123;</span><br><span class="line">       <span class="hljs-string">"user-agent"</span>: <span class="hljs-string">"YuThree"</span></span><br><span class="line">    &#125;</span><br><span class="line">&#125;;</span><br><span class="line"><span class="hljs-keyword">let</span> requestPostOpt = &#123;</span><br><span class="line">    ...requestGetOpt,</span><br><span class="line">    url:issuesUrl,</span><br><span class="line">    method: <span class="hljs-string">"POST"</span>,</span><br><span class="line">    form: <span class="hljs-string">""</span></span><br><span class="line">&#125;;</span><br><span class="line"><span class="hljs-built_in">console</span>.log(<span class="hljs-string">"开始初始化评论..."</span>);</span><br><span class="line"></span><br><span class="line">(<span class="hljs-keyword">async</span> <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params"></span>) </span>&#123;</span><br><span class="line">    <span class="hljs-built_in">console</span>.log(<span class="hljs-string">"开始检索链接，请稍等..."</span>);</span><br><span class="line">    </span><br><span class="line">    <span class="hljs-keyword">try</span> &#123;</span><br><span class="line">        </span><br><span class="line">        <span class="hljs-keyword">let</span> urls = sitemapXmlReader(config.sitemapUrl);</span><br><span class="line">        <span class="hljs-built_in">console</span>.log(<span class="hljs-string">`共检索到<span class="hljs-subst">$&#123;urls.length&#125;</span>个链接`</span>);</span><br><span class="line">        <span class="hljs-built_in">console</span>.log(urls)</span><br><span class="line">        <span class="hljs-built_in">console</span>.log(<span class="hljs-string">"开始获取已经初始化的issues:"</span>);</span><br><span class="line">		<span class="hljs-built_in">console</span>.log(<span class="hljs-string">'请求连接为---'</span>+issuesUrl)</span><br><span class="line">        <span class="hljs-keyword">let</span> issues = <span class="hljs-keyword">await</span> send(requestGetOpt);</span><br><span class="line">        <span class="hljs-built_in">console</span>.log(<span class="hljs-string">`已经存在<span class="hljs-subst">$&#123;issues.length&#125;</span>个issues`</span>);</span><br><span class="line">        </span><br><span class="line">        <span class="hljs-keyword">let</span> notinitissuelinks = urls.filter(<span class="hljs-function">(<span class="hljs-params">link</span>) =&gt;</span> &#123;</span><br><span class="line">           <span class="hljs-keyword">return</span> !issues.find(<span class="hljs-function">(<span class="hljs-params">item</span>) =&gt;</span> &#123;</span><br><span class="line">                link = removeProtocol(link);</span><br><span class="line">                <span class="hljs-keyword">return</span> item.body.includes(link);</span><br><span class="line">             &#125;);</span><br><span class="line">        &#125;); </span><br><span class="line">        <span class="hljs-keyword">if</span> (notinitissuelinks.length &gt; <span class="hljs-number">0</span>) &#123;</span><br><span class="line">            <span class="hljs-built_in">console</span>.log(<span class="hljs-string">`本次有<span class="hljs-subst">$&#123;notinitissuelinks.length&#125;</span>个链接需要初始化issue：`</span>);</span><br><span class="line">            <span class="hljs-built_in">console</span>.log(notinitissuelinks);</span><br><span class="line">            <span class="hljs-built_in">console</span>.log(<span class="hljs-string">"开始提交初始化请求, 大约需要2秒..."</span>);</span><br><span class="line">			setTimeout(<span class="hljs-keyword">async</span> ()=&gt;&#123;</span><br><span class="line">                <span class="hljs-keyword">let</span> initRet = <span class="hljs-keyword">await</span> notinitissuelinks.map(<span class="hljs-keyword">async</span> (item) =&gt; &#123;</span><br><span class="line">                    <span class="hljs-keyword">let</span> html = <span class="hljs-keyword">await</span> send(&#123; ...requestGetOpt, <span class="hljs-attr">url</span>: item &#125;);</span><br><span class="line">					<span class="hljs-keyword">let</span> $ = cheerio.load(html)</span><br><span class="line">                    <span class="hljs-keyword">let</span> title = $(<span class="hljs-string">"title"</span>).first().text();<span class="hljs-comment">//issue的标题 可以改</span></span><br><span class="line">                    <span class="hljs-keyword">let</span> pathLabel = md5Sign(url.parse(item).path);<span class="hljs-comment">//这里的md5与生成gitalk的需要相同 是issue的id</span></span><br><span class="line">                    <span class="hljs-keyword">let</span> body = <span class="hljs-string">`地址：<span class="hljs-subst">$&#123;item&#125;</span>&lt;br&gt;&lt;br&gt;简介：<span class="hljs-subst">$&#123;$(<span class="hljs-string">'#more'</span>).prev().text()&#125;</span>`</span>;<span class="hljs-comment">//可以自己编写想要的body issue的正文  地址不能改，前面的去重判断用到这个</span></span><br><span class="line">                    <span class="hljs-keyword">let</span> form = <span class="hljs-built_in">JSON</span>.stringify(&#123; body, <span class="hljs-attr">labels</span>: [config.kind, pathLabel], title, <span class="hljs-attr">client_id</span>:config.client_id, <span class="hljs-attr">client_secret</span>:config.client_secret&#125;);</span><br><span class="line">                    <span class="hljs-keyword">return</span> send(&#123; ...requestPostOpt, form &#125;);</span><br><span class="line">                &#125;);</span><br><span class="line">                <span class="hljs-built_in">console</span>.log(<span class="hljs-string">`已完成<span class="hljs-subst">$&#123;initRet.length&#125;</span>个！`</span>);</span><br><span class="line">                <span class="hljs-built_in">console</span>.log(<span class="hljs-string">"可以愉快的发表评论了！"</span>);</span><br><span class="line">            &#125;,<span class="hljs-number">2000</span>);</span><br><span class="line">        &#125; <span class="hljs-keyword">else</span> &#123;</span><br><span class="line">            <span class="hljs-built_in">console</span>.log(<span class="hljs-string">"本次发布无新增页面，无需初始化issue!!"</span>);</span><br><span class="line">        &#125;</span><br><span class="line">    &#125; <span class="hljs-keyword">catch</span> (e) &#123;</span><br><span class="line">        <span class="hljs-built_in">console</span>.log(<span class="hljs-string">`初始化issue出错，错误如下：`</span>);</span><br><span class="line">        <span class="hljs-built_in">console</span>.log(e);</span><br><span class="line">    &#125; <span class="hljs-keyword">finally</span> &#123;</span><br><span class="line">    </span><br><span class="line">    &#125;</span><br><span class="line">&#125;)();</span><br><span class="line"></span><br><span class="line"><span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">sitemapXmlReader</span>(<span class="hljs-params">file</span>) </span>&#123;</span><br><span class="line">    <span class="hljs-keyword">let</span> data = fs.readFileSync(file, <span class="hljs-string">"utf8"</span>);</span><br><span class="line">    <span class="hljs-keyword">let</span> sitemap = xmlParser(data);</span><br><span class="line">    <span class="hljs-keyword">return</span> sitemap.root.children.map(<span class="hljs-function"><span class="hljs-keyword">function</span> (<span class="hljs-params">url</span>) </span>&#123;</span><br><span class="line">        <span class="hljs-keyword">let</span> loc = url.children.filter(<span class="hljs-function"><span class="hljs-keyword">function</span> (<span class="hljs-params">item</span>) </span>&#123;</span><br><span class="line">            <span class="hljs-keyword">return</span> item.name === <span class="hljs-string">"loc"</span>;</span><br><span class="line">        &#125;)[<span class="hljs-number">0</span>];</span><br><span class="line">        <span class="hljs-keyword">return</span> loc.content;</span><br><span class="line">    &#125;);</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">removeProtocol</span>(<span class="hljs-params">url</span>) </span>&#123;</span><br><span class="line">    <span class="hljs-keyword">return</span> url.substr(url.indexOf(<span class="hljs-string">":"</span>));</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">send</span>(<span class="hljs-params">options</span>) </span>&#123;</span><br><span class="line">    <span class="hljs-keyword">return</span> <span class="hljs-keyword">new</span> <span class="hljs-built_in">Promise</span>(<span class="hljs-function"><span class="hljs-keyword">function</span> (<span class="hljs-params">resolve, reject</span>) </span>&#123;</span><br><span class="line">        request(options, <span class="hljs-function"><span class="hljs-keyword">function</span> (<span class="hljs-params">error, response, body</span>) </span>&#123;</span><br><span class="line">            <span class="hljs-keyword">if</span> (!error) &#123;</span><br><span class="line">                resolve(body);</span><br><span class="line">            &#125; <span class="hljs-keyword">else</span> &#123;</span><br><span class="line">                reject(error);</span><br><span class="line">            &#125;</span><br><span class="line">        &#125;);</span><br><span class="line">    &#125;);</span><br><span class="line">&#125;</span><br><span class="line"><span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">md5Sign</span>(<span class="hljs-params">data</span>) </span>&#123;</span><br><span class="line">    <span class="hljs-comment">// 加入字符编码</span></span><br><span class="line">    <span class="hljs-keyword">var</span> md5 = crypto.createHash(<span class="hljs-string">'md5'</span>).update(data).digest(<span class="hljs-string">'hex'</span>);</span><br><span class="line">    <span class="hljs-keyword">return</span> md5;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<ol start="3">
<li>执行脚本<blockquote>
<p>需要注意的是第二步中的sitemap插件会生成的sitemap.xml会包含全部的界面，包括标签页、关于页等，执行上面的代码也会对这些页面生成评论框(也就是一条issue)</p>
</blockquote>
</li>
</ol>
<p>完成上述操作后，执行下面的命令，就可以部署站点，并初始化所有的评论了。<br><figure class="highlight js hljs"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">hexo clean</span><br><span class="line">hexo generate</span><br><span class="line">hexo deploy</span><br><span class="line">node ./comment.js</span><br></pre></td></tr></table></figure></p>
<p>也可以通过在站点根目录的<code>package.json</code>文件中，新建<code>npm</code>脚本，一个命令搞定清除缓存、生成静态文件、提交git并生成issue的所有操作。<br><figure class="highlight js hljs"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"><span class="hljs-string">"scripts"</span>: &#123;</span><br><span class="line">    <span class="hljs-string">"start"</span>: <span class="hljs-string">"hexo clean &amp;&amp; hexo s"</span>,</span><br><span class="line">    <span class="hljs-string">"build"</span>: <span class="hljs-string">"hexo clean &amp;&amp; hexo generate &amp;&amp; hexo deploy &amp;&amp; node ./comment.js"</span></span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure></p>
<p>之后完成文章编写，或者其他的更新操作后，直接执行build即可<br><figure class="highlight js hljs"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">npm run build</span><br></pre></td></tr></table></figure></p>
<h3 id="后记"><a href="#后记" class="headerlink" title="后记"></a>后记</h3><ol>
<li>最开始的gittoken 获取后复制出来 他会带一个空格，也可能是我的复制姿势不对，导致开始的连接返回值不对，是个小坑</li>
<li>Gitalk在页面登陆初始化的时候，默认生成的issue label是链接的path，生成的时候用的path为了满足issue的label不超过50个字符所以都用md5加密了一下，这里就要注意里面的path与这里的path必须一致</li>
</ol>
<h3 id="参考"><a href="#参考" class="headerlink" title="参考"></a>参考</h3><p><a href="https://madordie.github.io/post/blog-gitment-auto-setup/" target="_blank" rel="noopener">Gitment/Gitalk自动初始化</a></p>
<p><a href="https://draveness.me/git-comments-initialize" target="_blank" rel="noopener">自动初始化 Gitalk 和 Gitment 评论</a></p>
<p><a href="https://blog.csdn.net/daihaoxin/article/details/84958369" target="_blank" rel="noopener">nodejs版本的Gitalk/Gitment评论自动初始化</a></p>
<h3 id="封面"><a href="#封面" class="headerlink" title="封面"></a>封面</h3><p><a style="background-color:black;color:white;text-decoration:none;padding:4px 6px;font-family:-apple-system, BlinkMacSystemFont, &quot;San Francisco&quot;, &quot;Helvetica Neue&quot;, Helvetica, Ubuntu, Roboto, Noto, &quot;Segoe UI&quot;, Arial, sans-serif;font-size:12px;font-weight:bold;line-height:1.2;display:inline-block;border-radius:3px" href="https://unsplash.com/photos/0tvS13hHcOI" target="_blank" rel="noopener noreferrer" title="Download free do whatever you want high-resolution photos from Matt Hardy"><span style="display:inline-block;padding:2px 3px"><svg xmlns="http://www.w3.org/2000/svg" style="height:12px;width:auto;position:relative;vertical-align:middle;top:-2px;fill:white" viewbox="0 0 32 32"><title>unsplash-logo</title><path d="M10 9V0h12v9H10zm12 5h10v18H0V14h10v9h12v-9z"/></svg></span><span style="display:inline-block;padding:2px 3px">Matt Hardy</span></a></p>

        </div>
        
        <div class="level is-size-7 is-uppercase">
            <div class="level-start">
                <div class="level-item">
                    <span class="is-size-6 has-text-grey has-mr-7">#</span>
                    <a class="has-link-grey -link" href="/tags/gitakl/">gitakl</a>, <a class="has-link-grey -link" href="/tags/hexo/">hexo</a>
                </div>
            </div>
        </div>
        
        
        
        <div class="social-share"></div>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/social-share.js@1.0.16/dist/css/share.min.css">
<script src="https://cdn.jsdelivr.net/npm/social-share.js@1.0.16/dist/js/social-share.min.js"></script>
        
    </div>
</div>



<div class="card">
    <div class="card-content">
        <h3 class="menu-label has-text-centered">喜欢这篇文章？打赏一下作者吧</h3>
        <div class="buttons is-centered">
            
                
<a class="button is-info donate">
    <span class="icon is-small">
        <i class="fab fa-alipay"></i>
    </span>
    <span>支付宝</span>
    <div class="qrcode"><img src="/images/Alipay.png" alt="支付宝"></div>
</a>

                
                
<a class="button is-success donate">
    <span class="icon is-small">
        <i class="fab fa-weixin"></i>
    </span>
    <span>微信</span>
    <div class="qrcode"><img src="/images/wechat.png" alt="微信"></div>
</a>

                
        </div>
    </div>
</div>



<div class="card card-transparent">
    <div class="level post-navigation is-flex-wrap is-mobile">
        
        
        <div class="level-end">
            <a class="level level-item has-link-grey  article-nav-next" href="/2019/06/30/pub-function/">
                <span class="level-item">js note some function</span>
                <i class="level-item fas fa-chevron-right"></i>
            </a>
        </div>
        
    </div>
</div>



<div class="card">
    <div class="card-content">
        <h3 class="title is-5 has-text-weight-normal">评论</h3>
        
<div id="comment-container"></div>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/gitalk@1.4.1/dist/gitalk.css">
<script src="https://cdn.jsdelivr.net/npm/gitalk@1.4.1/dist/gitalk.min.js"></script>
<script>
    var gitalk = new Gitalk({
        clientID: '2ad765d5f8399d6c74fb',
        clientSecret: '790ad25b36b8722d5fd225219105f31806898862',
        id: '44acc607bfc1e5b2bb5632d1db243636',
        repo: 'yuthreeComment',
        owner: 'YuThree',
        admin: ["YuThree"],
        createIssueManually: false,
        distractionFreeMode: false
    })
    gitalk.render('comment-container')
</script>

    </div>
</div>
</div>
                




<div class="column is-4-tablet is-3-desktop is-3-widescreen  has-order-1 column-left is-sticky">
    
        
<div class="card widget">
    <div class="card-content">
        <nav class="level">
            <div class="level-item has-text-centered" style="flex-shrink: 1">
                <div>
                    
                        <img class="image is-128x128 has-mb-6" src="/images/avatar.png" alt="ybc">
                    
                    
                    <p class="is-size-4 is-block">
                        ybc
                    </p>
                    
                    
                    <p class="is-size-6 is-block">
                        与其苟延残喘不如从容燃烧
                    </p>
                    
                    
                    <p class="is-size-6 is-flex is-flex-center has-text-grey">
                        <i class="fas fa-map-marker-alt has-mr-7"></i>
                        <span>中国成都</span>
                    </p>
                    
                </div>
            </div>
        </nav>
        <nav class="level is-mobile">
            <div class="level-item has-text-centered is-marginless">
                <div>
                    <p class="heading">
                        文章
                    </p>
                    <p class="title has-text-weight-normal">
                        8
                    </p>
                </div>
            </div>
            <div class="level-item has-text-centered is-marginless">
                <div>
                    <p class="heading">
                        分类
                    </p>
                    <p class="title has-text-weight-normal">
                        9
                    </p>
                </div>
            </div>
            <div class="level-item has-text-centered is-marginless">
                <div>
                    <p class="heading">
                        标签
                    </p>
                    <p class="title has-text-weight-normal">
                        9
                    </p>
                </div>
            </div>
        </nav>
        <div class="level">
            <a class="level-item button is-link is-rounded" href="https://github.com/YuThree" target="_blank">
                关注我</a>
        </div>
        
        
        <div class="level is-mobile">
            
            <a class="level-item button is-white is-marginless" target="_blank" title="Github" href="https://yuthree.github.io/">
                
                <i class="fab fa-github"></i>
                
            </a>
            
            <a class="level-item button is-white is-marginless" target="_blank" title="Facebook" href="http://facebook.com/100011677446168">
                
                <i class="fab fa-facebook"></i>
                
            </a>
            
            <a class="level-item button is-white is-marginless" target="_blank" title="Twitter" href="http://twitter.com">
                
                <i class="fab fa-twitter"></i>
                
            </a>
            
        </div>
        
    </div>
</div>
    
        
<div class="card widget" id="toc">
    <div class="card-content">
        <div class="menu">
            <h3 class="menu-label">
                目录
            </h3>
            <ul class="menu-list"><li>
        <a class="is-flex" href="#gitalk-setting">
        <span class="has-mr-6">1</span>
        <span>gitalk setting</span>
        </a><ul class="menu-list"><li>
        <a class="is-flex" href="#实现gitalk-自动为文章生成评论栏">
        <span class="has-mr-6">1.1</span>
        <span>实现gitalk 自动为文章生成评论栏</span>
        </a><ul class="menu-list"><li>
        <a class="is-flex" href="#第一步-获取github接口的调用权限">
        <span class="has-mr-6">1.1.1</span>
        <span>第一步 获取github接口的调用权限</span>
        </a></li><li>
        <a class="is-flex" href="#生成sitemap站点地图">
        <span class="has-mr-6">1.1.2</span>
        <span>生成sitemap站点地图</span>
        </a></li><li>
        <a class="is-flex" href="#脚本文件编写">
        <span class="has-mr-6">1.1.3</span>
        <span>脚本文件编写</span>
        </a></li><li>
        <a class="is-flex" href="#后记">
        <span class="has-mr-6">1.1.4</span>
        <span>后记</span>
        </a></li><li>
        <a class="is-flex" href="#参考">
        <span class="has-mr-6">1.1.5</span>
        <span>参考</span>
        </a></li><li>
        <a class="is-flex" href="#封面">
        <span class="has-mr-6">1.1.6</span>
        <span>封面</span>
        </a></li></ul></li></ul></li></ul>
        </div>
    </div>
</div>

    
        

<div class="card widget">
    <div class="card-content">
        <div class="menu">
        <h3 class="menu-label">
            链接
        </h3>
        <ul class="menu-list">
        
            <li>
                <a class="level is-mobile" href="https://hexo.io" target="_blank">
                    <span class="level-left">
                        <span class="level-item">Hexo</span>
                    </span>
                    <span class="level-right">
                        <span class="level-item tag">hexo.io</span>
                    </span>
                </a>
            </li>
        
            <li>
                <a class="level is-mobile" href="https://github.com/YuThree" target="_blank">
                    <span class="level-left">
                        <span class="level-item">github-YuThree</span>
                    </span>
                    <span class="level-right">
                        <span class="level-item tag">github.com</span>
                    </span>
                </a>
            </li>
        
            <li>
                <a class="level is-mobile" href="http://blog.sina.com.cn/s/articlelist_5643024172_0_1.html" target="_blank">
                    <span class="level-left">
                        <span class="level-item">个人新浪博客</span>
                    </span>
                    <span class="level-right">
                        <span class="level-item tag">blog.sina.com.cn</span>
                    </span>
                </a>
            </li>
        
            <li>
                <a class="level is-mobile" href="http://www.ruanyifeng.com/home.html" target="_blank">
                    <span class="level-left">
                        <span class="level-item">阮一峰</span>
                    </span>
                    <span class="level-right">
                        <span class="level-item tag">www.ruanyifeng.com</span>
                    </span>
                </a>
            </li>
        
            <li>
                <a class="level is-mobile" href="https://www.zhangxinxu.com/wordpress/" target="_blank">
                    <span class="level-left">
                        <span class="level-item">张鑫旭</span>
                    </span>
                    <span class="level-right">
                        <span class="level-item tag">www.zhangxinxu.com</span>
                    </span>
                </a>
            </li>
        
        </ul>
        </div>
    </div>
</div>


    
    
		<div class="column-right-shadow  ">
        
            
<div class="card widget">
    <div class="card-content">
        <h3 class="menu-label">
            最新文章
        </h3>
        
        <article class="media">
            
            <a href="/2019/08/06/gitalk-set/" class="media-left">
                <p class="image is-64x64">
                    <img class="thumbnail" src="/images/titlebg_20.jpg" alt="gitalk set">
                </p>
            </a>
            
            <div class="media-content">
                <div class="content">
                    <div><time class="has-text-grey is-size-7 is-uppercase" datetime="2019-08-06T02:22:34.000Z">2019-08-06</time></div>
                    <a href="/2019/08/06/gitalk-set/" class="title has-link-black-ter is-size-6 has-text-weight-normal">gitalk set</a>
                    <p class="is-size-7 is-uppercase">
                        <a class="has-link-grey -link" href="/categories/笔记/">笔记</a> / <a class="has-link-grey -link" href="/categories/笔记/hexo/">hexo</a>
                    </p>
                </div>
            </div>
        </article>
        
        <article class="media">
            
            <a href="/2019/06/30/pub-function/" class="media-left">
                <p class="image is-64x64">
                    <img class="thumbnail" src="/images/titlebg_24.jpg" alt="js note some function">
                </p>
            </a>
            
            <div class="media-content">
                <div class="content">
                    <div><time class="has-text-grey is-size-7 is-uppercase" datetime="2019-06-30T02:10:24.000Z">2019-06-30</time></div>
                    <a href="/2019/06/30/pub-function/" class="title has-link-black-ter is-size-6 has-text-weight-normal">js note some function</a>
                    <p class="is-size-7 is-uppercase">
                        <a class="has-link-grey -link" href="/categories/笔记/">笔记</a> / <a class="has-link-grey -link" href="/categories/笔记/js/">js</a>
                    </p>
                </div>
            </div>
        </article>
        
        <article class="media">
            
            <a href="/2019/06/15/vue-note-about-watch/" class="media-left">
                <p class="image is-64x64">
                    <img class="thumbnail" src="/images/titlebg_17.jpg" alt="vue note about watch">
                </p>
            </a>
            
            <div class="media-content">
                <div class="content">
                    <div><time class="has-text-grey is-size-7 is-uppercase" datetime="2019-06-15T08:51:34.000Z">2019-06-15</time></div>
                    <a href="/2019/06/15/vue-note-about-watch/" class="title has-link-black-ter is-size-6 has-text-weight-normal">vue note about watch</a>
                    <p class="is-size-7 is-uppercase">
                        <a class="has-link-grey -link" href="/categories/笔记/">笔记</a> / <a class="has-link-grey -link" href="/categories/笔记/vue/">vue</a>
                    </p>
                </div>
            </div>
        </article>
        
        <article class="media">
            
            <a href="/2019/06/13/VUE-note/" class="media-left">
                <p class="image is-64x64">
                    <img class="thumbnail" src="/images/titlebg_21.jpg" alt="VUE note about responsive">
                </p>
            </a>
            
            <div class="media-content">
                <div class="content">
                    <div><time class="has-text-grey is-size-7 is-uppercase" datetime="2019-06-13T05:16:25.000Z">2019-06-13</time></div>
                    <a href="/2019/06/13/VUE-note/" class="title has-link-black-ter is-size-6 has-text-weight-normal">VUE note about responsive</a>
                    <p class="is-size-7 is-uppercase">
                        <a class="has-link-grey -link" href="/categories/笔记/">笔记</a> / <a class="has-link-grey -link" href="/categories/笔记/vue/">vue</a>
                    </p>
                </div>
            </div>
        </article>
        
        <article class="media">
            
            <a href="/2018/04/04/img-show/" class="media-left">
                <p class="image is-64x64">
                    <img class="thumbnail" src="/images/titlebg_4.jpg" alt="img-show">
                </p>
            </a>
            
            <div class="media-content">
                <div class="content">
                    <div><time class="has-text-grey is-size-7 is-uppercase" datetime="2018-04-04T10:04:22.000Z">2018-04-04</time></div>
                    <a href="/2018/04/04/img-show/" class="title has-link-black-ter is-size-6 has-text-weight-normal">img-show</a>
                    <p class="is-size-7 is-uppercase">
                        <a class="has-link-grey -link" href="/categories/img/">img</a>
                    </p>
                </div>
            </div>
        </article>
        
    </div>
</div>

        
            <div class="card widget">
    <div class="card-content">
        <div class="menu">
        <h3 class="menu-label">
            归档
        </h3>
        <ul class="menu-list">
        
        <li>
            <a class="level is-marginless" href="/archives/2019/08/">
                <span class="level-start">
                    <span class="level-item">八月 2019</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">1</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2019/06/">
                <span class="level-start">
                    <span class="level-item">六月 2019</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">3</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2018/04/">
                <span class="level-start">
                    <span class="level-item">四月 2018</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">1</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2018/03/">
                <span class="level-start">
                    <span class="level-item">三月 2018</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">1</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2018/02/">
                <span class="level-start">
                    <span class="level-item">二月 2018</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">1</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2018/01/">
                <span class="level-start">
                    <span class="level-item">一月 2018</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">1</span>
                </span>
            </a>
        </li>
        
        </ul>
        </div>
    </div>
</div>
        
            <div class="card widget">
    <div class="card-content">
        <div class="menu">
            <h3 class="menu-label">
                标签
            </h3>
            <div class="field is-grouped is-grouped-multiline">
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/gitakl/">
                        <span class="tag">gitakl</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/hexo/">
                        <span class="tag">hexo</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/javascript/">
                        <span class="tag">javascript</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/note/">
                        <span class="tag">note</span>
                        <span class="tag is-grey">3</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/vue/">
                        <span class="tag">vue</span>
                        <span class="tag is-grey">2</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/壁纸/">
                        <span class="tag">壁纸</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/百度网盘/">
                        <span class="tag">百度网盘</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/网站收藏/">
                        <span class="tag">网站收藏</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/链接/">
                        <span class="tag">链接</span>
                        <span class="tag is-grey">2</span>
                    </a>
                </div>
                
            </div>
        </div>
    </div>
</div>
        
            
<div class="card widget">
    <div class="card-content">
        <h3 class="menu-label">
            标签云
        </h3>
        <a href="/tags/gitakl/" style="font-size: 10px;">gitakl</a> <a href="/tags/hexo/" style="font-size: 10px;">hexo</a> <a href="/tags/javascript/" style="font-size: 10px;">javascript</a> <a href="/tags/note/" style="font-size: 20px;">note</a> <a href="/tags/vue/" style="font-size: 15px;">vue</a> <a href="/tags/壁纸/" style="font-size: 10px;">壁纸</a> <a href="/tags/百度网盘/" style="font-size: 10px;">百度网盘</a> <a href="/tags/网站收藏/" style="font-size: 10px;">网站收藏</a> <a href="/tags/链接/" style="font-size: 15px;">链接</a>
    </div>
</div>

        
        </div>
    
</div>

				
            </div>
        </div>
    </section>
    <footer class="footer">
    <div class="container">
        <div class="level">
            <div class="level-start has-text-centered-mobile">
                <a class="footer-logo is-block has-mb-6" href="/">
                
                    <img src="/images/logo.svg" alt="gitalk set" height="28">
                
                </a>
                <p class="is-size-7">
                &copy; 2019 YuThree&nbsp;
                Powered by <a href="https://hexo.io/" target="_blank">Hexo</a> & <a href="https://github.com/ppoffice/hexo-theme-icarus" target="_blank">Icarus</a>
                
                <br>
                <span id="busuanzi_container_site_uv">
                共<span id="busuanzi_value_site_uv">0</span>个访客
                </span>
                
                </p>
            </div>
            <div class="level-end">
            
                <div class="field has-addons is-flex-center-mobile has-mt-5-mobile is-flex-wrap is-flex-middle">
                
                
                <p class="control">
                    <a class="button is-white is-large" target="_blank" title="Creative Commons" href="https://creativecommons.org/">
                        
                        <i class="fab fa-creative-commons"></i>
                        
                    </a>
                </p>
                
                <p class="control">
                    <a class="button is-white is-large" target="_blank" title="Attribution 4.0 International" href="https://creativecommons.org/licenses/by/4.0/">
                        
                        <i class="fab fa-creative-commons-by"></i>
                        
                    </a>
                </p>
                
                <p class="control">
                    <a class="button is-white is-large" target="_blank" title="Download on GitHub" href="http://github.com/ppoffice/hexo-theme-icarus">
                        
                        <i class="fab fa-github"></i>
                        
                    </a>
                </p>
                
                </div>
            
            </div>
        </div>
    </div>
</footer>
    <script src="https://cdn.jsdelivr.net/npm/jquery@3.3.1/dist/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/moment@2.22.2/min/moment-with-locales.min.js"></script>
<script>moment.locale("zh-CN");</script>

<script>
var IcarusThemeSettings = {
    article: {
        highlight: {
            clipboard: true,
            fold: 'unfolded'
        }
    }
};
</script>


    <script src="https://cdn.jsdelivr.net/npm/clipboard@2.0.4/dist/clipboard.min.js" defer></script>



    
    
    
    <script src="/js/animation.js"></script>
    

    
    
    
    <script src="https://cdn.jsdelivr.net/npm/lightgallery@1.6.8/dist/js/lightgallery.min.js" defer></script>
    <script src="https://cdn.jsdelivr.net/npm/justifiedGallery@3.7.0/dist/js/jquery.justifiedGallery.min.js" defer></script>
    <script src="/js/gallery.js" defer></script>
    

    
    

<div id="outdated">
    <h6>Your browser is out-of-date!</h6>
    <p>Update your browser to view this website correctly. <a id="btnUpdateBrowser" href="http://outdatedbrowser.com/">Update
            my browser now </a></p>
    <p class="last"><a href="#" id="btnCloseUpdateBrowser" title="Close">&times;</a></p>
</div>
<script src="https://cdn.jsdelivr.net/npm/outdatedbrowser@1.1.5/outdatedbrowser/outdatedbrowser.min.js" defer></script>
<script>
    document.addEventListener("DOMContentLoaded", function () {
        outdatedBrowser({
            bgColor: '#f25648',
            color: '#ffffff',
            lowerThan: 'flex'
        });
    });
</script>


    
    
<script src="https://cdn.jsdelivr.net/npm/mathjax@2.7.5/unpacked/MathJax.js?config=TeX-MML-AM_CHTML" defer></script>
<script>
document.addEventListener('DOMContentLoaded', function () {
    MathJax.Hub.Config({
        'HTML-CSS': {
            matchFontHeight: false
        },
        SVG: {
            matchFontHeight: false
        },
        CommonHTML: {
            matchFontHeight: false
        },
        tex2jax: {
            inlineMath: [
                ['$','$'],
                ['\\(','\\)']
            ]
        }
    });
});
</script>

    
    

<a id="back-to-top" title="回到顶端" href="javascript:;">
    <i class="fas fa-chevron-up"></i>
</a>
<script src="/js/back-to-top.js" defer></script>


    
    

    
    
    
    

    
    
    
    
    
    
    

    


<script src="/js/main.js" defer></script>

    
    <div class="searchbox ins-search">
    <div class="searchbox-container ins-search-container">
        <div class="searchbox-input-wrapper">
            <input type="text" class="searchbox-input ins-search-input" placeholder="想要查找什么...">
            <span class="searchbox-close ins-close ins-selectable"><i class="fa fa-times-circle"></i></span>
        </div>
        <div class="searchbox-result-wrapper ins-section-wrapper">
            <div class="ins-section-container"></div>
        </div>
    </div>
</div>
<script>
    (function (window) {
        var INSIGHT_CONFIG = {
            TRANSLATION: {
                POSTS: '文章',
                PAGES: '页面',
                CATEGORIES: '分类',
                TAGS: '标签',
                UNTITLED: '(无标题)',
            },
            CONTENT_URL: '/content.json',
        };
        window.INSIGHT_CONFIG = INSIGHT_CONFIG;
    })(window);
</script>
<script src="/js/insight.js" defer></script>
<link rel="stylesheet" href="/css/search.css">
<link rel="stylesheet" href="/css/insight.css">
    
<script src="/live2dw/lib/L2Dwidget.min.js?094cbace49a39548bed64abff5988b05"></script><script>L2Dwidget.init({"tagMode":false,"debug":false,"model":{"jsonPath":"/live2dw/assets/shizuku.model.json"},"display":{"position":"left","width":150,"height":300},"mobile":{"show":true},"react":{"opacity":0.7},"log":false,"pluginJsPath":"lib/","pluginModelPath":"assets/","pluginRootPath":"live2dw/"});</script></body>
</html>